package com.lhkj.ct.meta.modules.patient.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.FutureOrPresent;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 单位任务
 * </p>
 *
 * @author jobob
 * @since 2023-12-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblUnitTask对象", description="单位任务")
public class TblUnitTask implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务id")
    private String id;

    @TableField(updateStrategy = FieldStrategy.NEVER)
    @NotBlank(message = "请选择单位")
    @ApiModelProperty(value = "单位id")
    private String unitId;

    @TableField(updateStrategy = FieldStrategy.NEVER)
    @NotBlank(message = "单位名称不能为空")
    @ApiModelProperty(value = "单位名称")
    private String unitName;

    @NotBlank(message = "任务主题不能为空")
    @Length(max = 50, message = "任务主题不能超过{max}字符")
    @ApiModelProperty(value = "任务主题")
    private String title;

    @NotBlank(message = "任务内容不能为空")
    @Length(max = 500, message = "任务内容不能超过{max}字符")
    @ApiModelProperty(value = "任务内容")
    private String content;

    @FutureOrPresent(message = "提醒日期不能早于当前时间")
    @ApiModelProperty(value = "提醒日期")
    private LocalDate reminderDate;

    @ApiModelProperty(value = "状态", notes = "0.未处理 1.已处理")
    private Integer status;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;


}
